/*
 * @Description: 
 * @Author: 于子续
 * @Date: 2024-09-04 16:57:10
 * @LastEditors: 于子续
 * @LastEditTime: 2024-09-04 19:25:29
 */
/*
 * @Description: 
 * @Author: 于子续
 * @Date: 2024-09-04 16:57:10
 * @LastEditors: 于子续
 * @LastEditTime: 2024-09-04 18:59:00
 */
package day08;

import java.util.Arrays;
import java.util.Scanner;
public class Test04 {

    public static void main(String[] args) {
        int i = 0;
        Scanner in = new Scanner(System.in);

        System.out.println("请输入数据并用空格分隔！");
        String tmp = in.nextLine();//将一行数据读出
        String arr[] = tmp.split("\\s+");//使用正则表达式将字符串分割 “\\s+”表示多个空格
        int arr1[] = new int[arr.length];
        for (String s : arr) {
            arr1[i] = Integer.parseInt(s);//将字符串转换为int数组
            i++;
        }
        System.out.println(Arrays.toString(expand(arr1)));
    }


    private static int[] expand(int[] arr){
        int [] arr1 = new int[(arr.length)*2];
        System.arraycopy(arr,0,arr1,0,arr.length); 
        return arr1;
    }
}
